const el = document.getElementById("id") as HTMLImageElement;

// 类型断言 as
el.src = "url地址";

// 另类案例：Person是student的父类
class Person {}

class Student extends Person {}

function sayHello(p: Person) {}

const stu = new Student();
sayHello(stu);

// 转 any/unkonwn（不推荐）
const message = "Hello world";
const num: number = message as unknown as number;
